package com.power.using.askapp.fragment;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.TextView;

import com.power.using.askapp.R;
import com.power.using.askapp.base.BaseMainFragment;
import com.power.using.askapp.interfaces.Constant;
import com.power.using.askapp.utils.SPUtil;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import butterknife.Unbinder;

/**
 * Created by 聪明一只哈 on 2018/5/25.
 * Time: 2018/5/25  10:35
 */

public class ThreeFrament extends BaseMainFragment {


    @BindView(R.id.toolbar_title)
    TextView toolbarTitle;
    Unbinder unbinder;
    @BindView(R.id.button1)
    Button button1;
    @BindView(R.id.button2)
    Button button2;
    @BindView(R.id.button3)
    Button button3;
    @BindView(R.id.button4)
    Button button4;
    @BindView(R.id.button5)
    Button button5;

    public static ThreeFrament newInstance() {

        Bundle args = new Bundle();

        ThreeFrament fragment = new ThreeFrament();
        fragment.setArguments(args);
        return fragment;
    }

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {

        View view = inflater.inflate(R.layout.fragment_three, container, false);
        unbinder = ButterKnife.bind(this, view);
        initView(view);
        return view;
    }

    private void initView(View view) {
        toolbarTitle.setText("临时占位");

    }

    //懒加载
    @Override
    public void onLazyInitView(@Nullable Bundle savedInstanceState) {
        super.onLazyInitView(savedInstanceState);
        initMZBanner();
//        initRVData();
//        initListener();
    }

    //加载轮播
    private void initMZBanner() {

    }

    @Override
    public void onDestroyView() {
        super.onDestroyView();
        unbinder.unbind();
    }

    @OnClick({R.id.button1, R.id.button2, R.id.button3, R.id.button4, R.id.button5})
    public void onViewClicked(View view) {
        switch (view.getId()) {
            case R.id.button1:
                //SPUtil.putString(Constant.DEAIPROGRESS,"1");
                break;
            case R.id.button2:
                SPUtil.putString(Constant.DEAIPROGRESS,"2");
                break;
            case R.id.button3:
                SPUtil.putString(Constant.DEAIPROGRESS,"3");
                break;
            case R.id.button4:
                SPUtil.putString(Constant.DEAIPROGRESS,"4");
                break;
            case R.id.button5:
                SPUtil.putString(Constant.DEAIPROGRESS,"5");
                break;
        }
    }
}
